<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			/**
			 * @param {number} x
			 * @param {number} n
			 * @return {number}
			 */
			//输入：x = 2.00000, n = 10
			//输出：1024.00000
			var myPow = function(x, n) {
				let v = x;
				if(x == 1){
					return 1;
				}
				if(n>0){
					while(n > 1){
						// console.log(x);
						n--;
						x *= v;
					}
					return x;
				}else if(n==0){
					return 1;
				}else{
					while(n < 1){
						// console.log(x);
						n++;
						x /= v;
					}
					return x;
				}
			};
			// console.log(myPow(2,10));
			// console.log(myPow(2,-2));
			// console.log(myPow(0.44528,0));
			// console.log(myPow(2.1,3));
			// console.log(myPow(1,-2147483648));
			// console.log(myPow(2,-2147483648));//测试用例有问题,这里跑不通,超时.
		</script>
	</body>
</html>
